package com.sy.controller;

import com.sy.dto.JsonResult;
import com.sy.entity.Cartoon;
import com.sy.service.CartoonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("soar")
public class ClickController {

    @Autowired
    private CartoonService service;

    @RequestMapping(method = RequestMethod.GET)
    @ResponseBody
    public JsonResult getClick(){
        JsonResult result = new JsonResult();
        List<Cartoon> sortByClick = service.getSortByClick();
        result.setData(sortByClick);
        return result;

}
}
